using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using SnowModel;

namespace Tester
{
    class Program
    {
        static void Main(string[] args)

        {
            /*
            //open file with gru info and store in object array
            string gruInNames;
            string gruLine;
            FileInfo gruInfoFile = new FileInfo(@"C:\models\PTModel\input\gruInfo-new.csv");
            StreamReader gruInfoStream = gruInfoFile.OpenText();
            gruInNames = gruInfoStream.ReadLine();
            
            
            
            List<GRUGeorg> GruPTM = new List<GRUGeorg>();
            gruLine = gruInfoStream.ReadLine();

            while (gruLine != null)
            {
            string[] gruSplit = gruLine.Split(',');
            int id = gruLine[0];
            double[] xyz = new double[3];
            xyx[1] = Convert.ToDouble(gruLine[1])
                , gruLine[2], gruLine[3]);
            double aspect = Convert.ToDouble(gruLine[4]);
            double slope = Convert.ToDouble(gruLine[5]);
            double fc = Convert.ToDouble(gruLine[6]);
            double dia = Convert.ToDouble(gruLine[7]);
            double hs = Convert.ToDouble(gruLine[8]);
            double hc = Convert.ToDouble(gruLine[9]);
            double nc = Convert.ToDouble(gruLine[10]);
                //GruPTM.Add(new GRUGeorg(id,
                gruLine = gruInfoStream.ReadLine();
            }



            ClimateClass ClimateForcing = new ClimateClass("C:\\models\\PTModel\\input\\clu-header.csv");
            ClimateForcing.MoveToObservationDate(new DateTime(2008, 7, 9, 12, 0, 0));
            while (ClimateForcing.MoveToNextObservation())
            {
                Console.WriteLine(string.Format("Current date: {0}", ClimateForcing.CurrentDateTime.ToString("yyyy-MM-dd HH:mm:ss")));
                double airTemp = (double)ClimateForcing.CurrentClimateObservations["T_LAPSE"];
                Console.WriteLine(string.Format("Current Tlapse: {0}", airTemp));
            }
            Console.ReadLine();
            */

            //GRUClass myHBV = new GRUFlat(
            Regex reg = new Regex(@":GRUdescription\s+");

            string s = "c:\\models\\PTModel\\input\\gruinfo-new.csv";
            StreamReader sr = new StreamReader(s);
            string contents = sr.ReadToEnd();

            string[] info = reg.Split(contents);
            Console.WriteLine(info[1]);
            Console.ReadLine();
            string[] body = Regex.Split(info[1], @"\r\n");
            Console.WriteLine(body.Length.ToString());
            for (int i = 0; i < 10; i++)
            {
                Console.WriteLine(body[i]);
                //Console.ReadLine();
            }
            Console.ReadLine();
            Console.WriteLine(info[2]);
            Console.ReadLine();

        }
    }
}
